package day1;

import java.util.ArrayList;
import java.util.Collection;

/**
 * ClassName：CollectionTest
 *
 * @Author：小鱼
 * @Create：2025-08-11 10:03
 */
public class CollectionTest {
    public static void main(String[] args) {
        Collection<String> collection = new ArrayList<String>();
        Collection<String> collection2 = new ArrayList();
        Collection collection3 = new ArrayList();

        //使用集合
        if (collection.isEmpty()){
            System.out.println("collection为空");
        }
        System.out.println("长度为"+collection.size());//长度

        //增加元素,可以放任何数据类型
        collection3.add("hello");
        Integer integer = 1;
        collection3.add(integer);
        collection3.add('c');
        collection3.add(1);
        System.out.println(collection3);

    }
}
